package set.test3;

import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        //1.创建集合
        TreeSet<Student> ts = new TreeSet<>();
        //2.创建学生对象
        Student stu1 = new Student("jack", 22,99, 65, 44 );
        Student stu2 = new Student("tom", 33,99, 65, 56 );
        Student stu3 = new Student("jk", 24,67, 45, 44 );
        Student stu4 = new Student("aniu", 15,33, 88, 57 );
        //3.添加到集合中
        ts.add(stu1);
        ts.add(stu2);
        ts.add(stu3);
        ts.add(stu4);
        //4.打印集合
        for (Student t : ts) {
            System.out.println(t + "---> " + t.getSum());
        }
    }
}
